Skip to content

[pull] main from Shopify:main - #202

Merged
pull[bot] merged 1 commit into
code:mainfrom
Shopify:main
Jul 10, 2026
Merged

[pull] main from Shopify:main#202
pull[bot] merged 1 commit into
code:mainfrom
Shopify:main

Conversation

@pull

@pull pull Bot commented Jul 10, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…stry (#3932)

On iOS (and Android), every image drawn in a Canvas — most visibly
makeImageFromView snapshots at ~W*H*4 bytes each — could stay resident
after dispose(), GC, and unmount:

1. NativeReanimatedContainer never stopped its Reanimated mapper on
   unmount; stopMapper only ran at the start of the next redraw, which
   never comes for an unmounted Canvas. The leaked mapper closure
   permanently retained the recorder (whose commands hold sk_sp<SkImage>
   copies of every drawn image) and the SkPicture, so the CFData pixel
   copy made in ViewScreenshotService was never released. Stop the
   mapper in unmount() (native and web containers).

2. The leaked mapper (or the queued first-frame runOnUI) kept calling
   setJsiProperty(nativeId, "picture", ...) after the native view had
   unregistered, and ViewRegistry::withViewInfo recreated the erased
   entry, storing the sk_sp<SkPicture> in the process-global registry
   under a nativeId that is never reused — a permanent leak. Tombstone
   unregistered ids so late property updates get a transient info object
   instead of resurrecting the entry (registration paths revive the id,
   which also keeps ids valid across JS reloads).

3. requestRedraw/makeImageSnapshot(Async)/size created empty registry
   entries for unknown ids; they now use a read-only lookup.
@pull pull Bot locked and limited conversation to collaborators Jul 10, 2026
@pull pull Bot added the ⤵️ pull label Jul 10, 2026
@pull
pull Bot merged commit 89f6954 into code:main Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant